package com.example.controller;

import com.example.pojo.TeachingStudentScoring;
import com.example.service.TeachingService;
import com.example.utils.Result;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@Api(value = "教学管理接口")
public class TeachingController {
    @Autowired
    private TeachingService teachingService;

    //添加
    @PostMapping("/teaching")
    public Result add(@RequestBody TeachingStudentScoring teachingStudentScoring){
        teachingService.addStudentScore(teachingStudentScoring);
        return Result.success();
    }


    //查询
    @GetMapping("/teaching")
    public Result query(@RequestParam Integer stuInClassId){
        TeachingStudentScoring teachingStudentScoring = teachingService.query(stuInClassId);
        return Result.success(teachingStudentScoring);
    }
}
